package main

import "fmt"

type Flyable interface {
	Fly() error;
	Say(name string) (string,error);
	SetName(name string) (Bird,error);
}

type Bird struct {
	Age int;
	Name string;
}

func (b *Bird)Fly() error  {
	fmt.Println("l can fly");
	return nil
}

func (b *Bird)Say(name string) (string,error) {
	fmt.Println("I am " + b.Name);
	fmt.Println("hello: " + name)
	return b.Name,nil
}

func (b *Bird)SetName(name string) (Bird,error)  {
	b.Name = name
	return *b,nil
}

func makeFly(f Flyable)  {

	f.Fly();
	f.Say("mike")

	f.SetName("哈哈哈哈")
}


func main() {

	b := Bird{
		Name: "feiffy",
		Age: 23,
	}

	makeFly(&b)

	fmt.Println(b.Name)
}
